package chpt06;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class HashSetDemo02 {

	public static void main(String[] args) {
		Set<StudentV1> students = new HashSet<>();
		students.add(new StudentV1("Lucy",17));
		students.add(new StudentV1("Mike",19));
		students.add(new StudentV1("Lucy",17));  // 加入重复数据
		Iterator<StudentV1> it = students.iterator();
		while(it.hasNext()) {
			System.out.println(it.next());
		}
	}
}
